<?php
class Model_Kierunki{

    private $table_name = 'kierunek';
    protected $results;

public function __construct(){
        require_once("../../dbConnection.php");
}
	
public function getID($kierunek_name){
	$this->results = mssql_query("SELECT id FROM $this->table_name WHERE nazwa='$kierunek_name'");
        $row = mssql_fetch_array($this->results);
  return $row['id'];
}
public function getAll(){
       $this->results = mssql_query("SELECT * FROM $this->table_name");
       while ($row = mssql_fetch_assoc($this->results)) {
             $directions[] = $row;
       }
  return $directions;
}
public function __destruct(){
	mssql_free_result($this->results);
	//mssql_close($con);
}
}
?>
